#ifndef LIN_MASTER_H
#define LIN_MASTER_H

#include "Cpu.h"

/*报文的类型是主机发送还是主机接收*/
typedef enum
{
    LIN_MSG_TYPE_TX = 0,
    LIN_MSG_TYPE_RX
}LIN_MSG_TYPE;

/*定义报文的类型、ID等信息*/
typedef struct
{
    UART_LinHeader_t uartLinHeader;
    UART_LinResponse_t uartLinMasterResponse;
    LIN_MSG_TYPE msg_type;
}LIN_FRAME_INFO;

/*定义LIN使用的UARTID*/
#define LIN_MASTER_UART_ID UART0_ID

/*定义调度表的报文数量和ID*/
#define LIN_ID_MAX 2u
#define LIN_ID_BCM 0x11
#define LIN_ID_RM 0x15
#define LIN_ID_RL 0x14
#define LIN_ID_RR 0x21
#define LIN_ID_FL 0x34
#define LIN_ID_FM 0x35
#define LIN_ID_FR 0x36
#define LIN_ID_E12 0x04


extern LIN_FRAME_INFO linframe[LIN_ID_MAX];
extern void lin_PeriodHandle(void);
extern void lin_master_Init(void);


#endif 
